<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">

    <div class="modal-header">
        <h4 class="modal-title" id="myTestEntityLabel" jhiTranslate="studyng6App.testEntity.home.createOrEditLabel">Create or edit a Test Entity</h4>
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                (click)="clear()">&times;</button>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" [hidden]="!testEntity.id">
            <label for="id" jhiTranslate="global.field.id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                   [(ngModel)]="testEntity.id" readonly />
        </div>
        <div class="form-group">
            <label class="form-control-label" jhiTranslate="studyng6App.testEntity.fileField" for="field_fileField">File Field</label>
            <div>
                <img [src]="'data:' + testEntity.fileFieldContentType + ';base64,' + testEntity.fileField" style="max-height: 100px;" *ngIf="testEntity.fileField" alt="testEntity image"/>
                <div *ngIf="testEntity.fileField" class="form-text text-danger clearfix">
                    <span class="pull-left">{{testEntity.fileFieldContentType}}, {{byteSize(testEntity.fileField)}}</span>
                    <button type="button" (click)="clearInputImage('fileField', 'fileFieldContentType', 'fileImage')" class="btn btn-secondary btn-xs pull-right">
                        <span class="fa fa-times"></span>
                    </button>
                </div>
                <input type="file" id="file_fileField" (change)="setFileData($event, testEntity, 'fileField', true)" accept="image/*" jhiTranslate="entity.action.addimage"/>
            </div>
            <input type="hidden" class="form-control" name="fileField" id="field_fileField"
                [(ngModel)]="testEntity.fileField" />
            <input type="hidden" class="form-control" name="fileFieldContentType" id="field_fileFieldContentType"
                [(ngModel)]="testEntity.fileFieldContentType" />
        </div>

    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
            <span class="fa fa-ban"></span>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
        </button>
        <button type="submit" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
            <span class="fa fa-save"></span>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
        </button>
    </div>
</form>
